"""
AI对话平台URL配置
"""

from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    AIProviderViewSet, AIModelViewSet, AIRoleViewSet, AIConversationViewSet
)
from .views_extended import (
    AIMessageViewSet, TokenUsageLogViewSet, MessageTemplateViewSet, UserFavoriteViewSet
)

# 创建路由器
router = DefaultRouter()

# 注册ViewSet
router.register(r'providers', AIProviderViewSet, basename='aiprovider')
router.register(r'models', AIModelViewSet, basename='aimodel')
router.register(r'roles', AIRoleViewSet, basename='airole')
router.register(r'conversations', AIConversationViewSet, basename='aiconversation')
router.register(r'messages', AIMessageViewSet, basename='aimessage')
router.register(r'token-usage', TokenUsageLogViewSet, basename='tokenusagelog')
router.register(r'templates', MessageTemplateViewSet, basename='messagetemplate')
router.register(r'favorites', UserFavoriteViewSet, basename='userfavorite')

# URL模式
urlpatterns = [
    # API路由
    path('ai-chat/', include(router.urls)),
]

# 应用命名空间
app_name = 'ai_chat'
